UNPKG

pulse-dashboard

Version:

A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions, based on playwright-pulse-report. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI too

4 lines (3 loc) 13.7 kB
module.exports=[93695,(e,t,r)=>{t.exports=e.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},18622,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},24725,(e,t,r)=>{t.exports=e.x("next/dist/server/app-render/after-task-async-storage.external.js",()=>require("next/dist/server/app-render/after-task-async-storage.external.js"))},14747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},24868,(e,t,r)=>{t.exports=e.x("fs/promises",()=>require("fs/promises"))},97953,(e,t,r)=>{"use strict";t.exports=e.r(42315).vendored["react-rsc"].ReactServerDOMTurbopackServer},45015,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"registerServerReference",{enumerable:!0,get:function(){return s.registerServerReference}});let s=e.r(97953)},95975,(e,t,r)=>{"use strict";function s(e){for(let t=0;t<e.length;t++){let r=e[t];if("function"!=typeof r)throw Object.defineProperty(Error(`A "use server" file can only export async functions, found ${typeof r}. Read more: https://nextjs.org/docs/messages/invalid-use-server-value`),"__NEXT_ERROR_CODE",{value:"E352",enumerable:!1,configurable:!0})}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ensureServerEntryExports",{enumerable:!0,get:function(){return s}})},41517,e=>{"use strict";var t=e.i(47909),r=e.i(74017),s=e.i(96250),n=e.i(59756),o=e.i(61916),a=e.i(74677),i=e.i(69741),l=e.i(16795),c=e.i(87718),u=e.i(95169),d=e.i(47587),p=e.i(66012),R=e.i(70101),f=e.i(26937),g=e.i(10372),h=e.i(93695);e.i(52474);var m=e.i(220),E=e.i(89171),v=e.i(14747),w=e.i(45015),x=e.i(24868);async function y(){console.log("[ACTIONS getRawHistoricalReports] ------------- START -------------");let e=process.env.PULSE_USER_CWD,t=process.env.PULSE_REPORT_DIR,r=process.cwd();console.log("[ACTIONS getRawHistoricalReports] process.env.PULSE_USER_CWD:",e),console.log("[ACTIONS getRawHistoricalReports] process.env.PULSE_REPORT_DIR:",t),console.log("[ACTIONS getRawHistoricalReports] process.cwd():",r);let s=e&&""!==e.trim()?e.trim():r,n=t&&""!==t.trim()?t.trim():v.default.join(s,"pulse-report");console.log("[ACTIONS getRawHistoricalReports] Effective baseDir determined:",s),console.log("[ACTIONS getRawHistoricalReports] Effective reportDir determined:",n);let o=v.default.join(n,"history");console.log("[ACTIONS getRawHistoricalReports] Attempting to read history directory:",o);try{let e=(await x.default.readdir(o)).filter(e=>e.startsWith("trend-")&&e.endsWith(".json"));console.log(`[ACTIONS getRawHistoricalReports] Found ${e.length} trend files in ${o}`);let t=[];for(let r of e){let e=v.default.join(o,r);try{let s=await x.default.readFile(e,"utf-8"),n=JSON.parse(s);n.run&&n.results?(void 0===n.run.flakinessRate&&(n.run.flakinessRate=0),t.push(n)):console.warn(`[ACTIONS getRawHistoricalReports] Skipping invalid historical report file (missing run or results): ${r}`)}catch(e){console.error(`[ACTIONS getRawHistoricalReports] Error reading or parsing historical file ${r}:`,e)}}return t.sort((e,t)=>new Date(e.run.timestamp).getTime()-new Date(t.run.timestamp).getTime()),console.log("[ACTIONS getRawHistoricalReports] ------------- END (SUCCESS) -------------"),t}catch(e){return console.error(`[ACTIONS getRawHistoricalReports] Error accessing or reading historical trends directory ${o}:`,e.message),e instanceof Error&&"ENOENT"===e.code&&console.warn(`[ACTIONS getRawHistoricalReports] History directory not found at ${o}. This is normal if no historical reports exist yet.`),console.log("[ACTIONS getRawHistoricalReports] ------------- END (ERROR) -------------"),[]}}async function A(){try{let e=await y();if(0===e.length)return console.log("[ACTIONS getFlakyTestsAnalysis] No historical reports found or an error occurred in getRawHistoricalReports. Returning empty flaky tests."),{success:!0,flakyTests:[]};let t=new Map;for(let r of e){if(!r.results){console.warn("[ACTIONS getFlakyTestsAnalysis] Skipping a report in history due to missing .results property.");continue}for(let e of r.results)t.has(e.id)||t.set(e.id,{name:e.name,suiteName:e.suiteName,occurrences:[]}),t.get(e.id).occurrences.push({runTimestamp:r.run.timestamp,status:e.status})}let r=[];for(let[e,s]of t.entries()){let t=new Set(s.occurrences.map(e=>e.status)),n=t.has("passed"),o=t.has("failed")||t.has("timedOut");if(n&&o){let t=0,n=0,o=0,a=0;s.occurrences.forEach(e=>{"passed"===e.status?t++:"failed"===e.status||"timedOut"===e.status?n++:"skipped"===e.status?o++:"pending"===e.status&&a++});let i=s.occurrences.sort((e,t)=>new Date(e.runTimestamp).getTime()-new Date(t.runTimestamp).getTime());r.push({id:e,name:s.name,suiteName:s.suiteName,occurrences:i,passedCount:t,failedCount:n,skippedCount:o,pendingCount:a,totalRuns:s.occurrences.length,firstSeen:i[0]?.runTimestamp||"",lastSeen:i[i.length-1]?.runTimestamp||""})}}return r.sort((e,t)=>t.failedCount/t.totalRuns-e.failedCount/e.totalRuns||t.totalRuns-e.totalRuns),{success:!0,flakyTests:r}}catch(e){return console.error("[ACTIONS getFlakyTestsAnalysis] Error analyzing flaky tests:",e),{success:!1,error:e instanceof Error?e.message:"An unknown error occurred during flaky test analysis."}}}async function T(){console.log("[API /api/historical-trends] Route hit.");let e=process.env.PULSE_USER_CWD,t=process.env.PULSE_REPORT_DIR,r=process.cwd();console.log("[API /api/historical-trends] process.env.PULSE_USER_CWD (inside API route):",e),console.log("[API /api/historical-trends] process.env.PULSE_REPORT_DIR (inside API route):",t),console.log("[API /api/historical-trends] process.cwd() (inside API route):",r);let s=e&&""!==e.trim()?e.trim():r,n=t&&""!==t.trim()?t.trim():v.default.join(s,"pulse-report");console.log("[API /api/historical-trends] Effective baseDir determined for API route (should match actions):",s),console.log("[API /api/historical-trends] Effective reportDir determined for API route:",n);try{let e=await y();if(!e)return console.error("[API /api/historical-trends] getRawHistoricalReports returned undefined/null. This is unexpected."),E.NextResponse.json({message:"Internal error: Failed to retrieve historical reports data structure."},{status:500});console.log(`[API /api/historical-trends] Received ${e.length} raw reports from getRawHistoricalReports.`);let t=e.filter(e=>void 0!==e.run&&null!==e.run).map(e=>{let t;if(e.results&&e.results.length>0){let r=new Set;e.results.forEach(e=>{void 0!==e.workerId&&null!==e.workerId&&r.add(e.workerId)}),r.size>0&&(t=r.size)}return{date:e.run.timestamp,totalTests:e.run.totalTests,passed:e.run.passed,failed:e.run.failed+(e.run.timedOut||0),skipped:e.run.skipped,duration:e.run.duration,flakinessRate:e.run.flakinessRate,workerCount:t}}).sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime());return console.log(`[API /api/historical-trends] Successfully processed ${t.length} historical trend items.`),E.NextResponse.json(t,{status:200})}catch(t){console.error("[API /api/historical-trends] Error processing historical trends in API route:",t);let e=t instanceof Error?t.message:"An unknown error occurred while processing historical trends.";return E.NextResponse.json({message:`Error processing historical trends: ${e}`,details:String(t)},{status:500})}}(0,e.i(95975).ensureServerEntryExports)([y,A]),(0,w.registerServerReference)(y,"00eb0c3664b06d971aaa7dd2c76b9b0f9440b9dbb2",null),(0,w.registerServerReference)(A,"008fa02e9805f6239c3ac102767cce196a0538ded4",null),e.s(["GET",()=>T],8624);var S=e.i(8624);let C=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/historical-trends/route",pathname:"/api/historical-trends",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/historical-trends/route.ts",nextConfigOutput:"",userland:S}),{workAsyncStorage:I,workUnitAsyncStorage:O,serverHooks:P}=C;function N(){return(0,s.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:O})}async function b(e,t,s){C.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/historical-trends/route";E=E.replace(/\/index$/,"")||"/";let v=await C.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!v)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:w,params:x,nextConfig:y,parsedUrl:A,isDraftMode:T,prerenderManifest:S,routerServerContext:I,isOnDemandRevalidate:O,revalidateOnlyGenerated:P,resolvedPathname:N,clientReferenceManifest:b,serverActionsManifest:k}=v,_=(0,i.normalizeAppPath)(E),D=!!(S.dynamicRoutes[_]||S.routes[N]),H=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,A,!1):t.end("This page could not be found"),null);if(D&&!T){let e=!!S.routes[N],t=S.dynamicRoutes[_];if(t&&!1===t.fallback&&!e){if(y.experimental.adapterPath)return await H();throw new h.NoFallbackError}}let j=null;!D||C.isDev||T||(j="/index"===(j=N)?"/":j);let U=!0===C.isDev||!D,q=D&&!U;k&&b&&(0,a.setManifestsSingleton)({page:E,clientReferenceManifest:b,serverActionsManifest:k});let $=e.method||"GET",M=(0,o.getTracer)(),F=M.getActiveScopeSpan(),L={params:x,prerenderManifest:S,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:U,incrementalCache:(0,n.getRequestMeta)(e,"incrementalCache"),cacheLifeProfiles:y.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,n)=>C.onRequestError(e,t,s,n,I)},sharedContext:{buildId:w}},K=new l.NodeNextRequest(e),W=new l.NodeNextResponse(t),B=c.NextRequestAdapter.fromNodeNextRequest(K,(0,c.signalFromNodeResponse)(t));try{let a=async e=>C.handle(B,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==u.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${$} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t)}else e.updateName(`${$} ${E}`)}),i=!!(0,n.getRequestMeta)(e,"minimalMode"),l=async n=>{var o,l;let c=async({previousCacheEntry:r})=>{try{if(!i&&O&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let o=await a(n);e.fetchMetrics=L.renderOpts.fetchMetrics;let l=L.renderOpts.pendingWaitUntil;l&&s.waitUntil&&(s.waitUntil(l),l=void 0);let c=L.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(K,W,o,L.renderOpts.pendingWaitUntil),null;{let e=await o.blob(),t=(0,R.toNodeOutgoingHttpHeaders)(o.headers);c&&(t[g.NEXT_CACHE_TAGS_HEADER]=c),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,s=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:o.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await C.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:O})},!1,I),t}},u=await C.handleResponse({req:e,nextConfig:y,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:P,responseGenerator:c,waitUntil:s.waitUntil,isMinimalMode:i});if(!D)return null;if((null==u||null==(o=u.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(l=u.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});i||t.setHeader("x-nextjs-cache",O?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let h=(0,R.fromNodeOutgoingHttpHeaders)(u.value.headers);return i&&D||h.delete(g.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||h.get("Cache-Control")||h.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(K,W,new Response(u.value.body,{headers:h,status:u.value.status||200})),null};F?await l(F):await M.withPropagatedContext(e.headers,()=>M.trace(u.BaseServerSpan.handleRequest,{spanName:`${$} ${E}`,kind:o.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},l))}catch(t){if(t instanceof h.NoFallbackError||await C.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:O})},!1,I),D)throw t;return await (0,p.sendResponse)(K,W,new Response(null,{status:500})),null}}e.s(["handler",()=>b,"patchFetch",()=>N,"routeModule",()=>C,"serverHooks",()=>P,"workAsyncStorage",()=>I,"workUnitAsyncStorage",()=>O],41517)}]; //# sourceMappingURL=%5Broot-of-the-server%5D__9f88b7b7._.js.map